package com.example.demo.itemProcessor;

import org.springframework.batch.item.ItemProcessor;
import org.springframework.stereotype.Component;

import java.util.Locale;

@Component("firstNameUpper")
public class FirstNameUpper implements ItemProcessor<Customer,Customer> {

    @Override
    public Customer process(Customer customer) throws Exception {
        Customer cus =new Customer();
        cus.setId(customer.getId());
        cus.setFirstName("修改后啦啦啦"+customer.getFirstName().toUpperCase(Locale.ROOT));
        cus.setLastName(customer.getLastName());
        cus.setBirthday(customer.getBirthday());
        return cus;
    }
}
